<html>
<head><meta charset="utf-8"><title>display_fn · rustdoc · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/index.html">rustdoc</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/display_fn.html">display_fn</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="224423160"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/display_fn/near/224423160" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/display_fn.html#224423160">(Jan 29 2021 at 02:10)</a>:</h4>
<p>Why is <code>display_fn</code> needed? Is it a lifetimes issue?</p>



<a name="224423312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/display_fn/near/224423312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/display_fn.html#224423312">(Jan 29 2021 at 02:13)</a>:</h4>
<p>Ah, it seems like maybe it makes a closure that takes a <code>Formatter</code>...</p>



<a name="224423736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/display_fn/near/224423736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/display_fn.html#224423736">(Jan 29 2021 at 02:21)</a>:</h4>
<p>Specifically, it seems to wrap a closure that takes a <code>Formatter</code> such that it implements <code>Display</code>.</p>



<a name="224437512"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/display_fn/near/224437512" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dániel Buga <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/display_fn.html#224437512">(Jan 29 2021 at 07:17)</a>:</h4>
<p><code>display_fn</code> takes a closure and allows you to print/format in that closure without allocating a temporary string. At least it allows you to do this, but I'm not sure of it's original intent.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>